package cn.gson.fengboot.model.pojos;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Objects;

@Entity
@Table(name = "tfyrelationwarn_from", schema = "springboot", catalog = "")
public class TfyrelationwarnFrom {//联系提醒表
    private int relationwarnId;//联系提醒id
    private String relationwarnNr;//联系提醒内容
    private String relationwarnLx;//联系提醒类型
    private Timestamp relationwarnTime;//联系提醒时间
    private Integer relationwarnZt;//联系提醒状态
    private QempFrom empId;//员工表
    private TfyclientForm clientId;//客户表
    private TfyclueForm clueId;//线索表
    private TfylinkmanForm linkmanId;//联系人表

    @Id
    @Column(name = "relationwarn_id", nullable = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY, generator = "seq")
    public int getRelationwarnId() {
        return relationwarnId;
    }

    public void setRelationwarnId(int relationwarnId) {
        this.relationwarnId = relationwarnId;
    }

    @Basic
    @Column(name = "relationwarn_nr", nullable = true, length = 255)
    public String getRelationwarnNr() {
        return relationwarnNr;
    }

    public void setRelationwarnNr(String relationwarnNr) {
        this.relationwarnNr = relationwarnNr;
    }

    @Basic
    @Column(name = "relationwarn_lx", nullable = true, length = 255)
    public String getRelationwarnLx() {
        return relationwarnLx;
    }

    public void setRelationwarnLx(String relationwarnLx) {
        this.relationwarnLx = relationwarnLx;
    }

    @Basic
    @Column(name = "relationwarn_time", nullable = true)
    public Timestamp getRelationwarnTime() {
        return relationwarnTime;
    }

    public void setRelationwarnTime(Timestamp relationwarnTime) {
        this.relationwarnTime = relationwarnTime;
    }

    @Basic
    @Column(name = "relationwarn_zt", nullable = true)
    public Integer getRelationwarnZt() {
        return relationwarnZt;
    }

    public void setRelationwarnZt(Integer relationwarnZt) {
        this.relationwarnZt = relationwarnZt;
    }

    //联系提醒多对员工一
    @ManyToOne
    @JoinColumn(name = "emp_id")
    public QempFrom getEmpId() {
        return empId;
    }

    public void setEmpId(QempFrom empId) {
        this.empId = empId;
    }

    //联系提醒多对客户一
    @ManyToOne
    @JoinColumn(name = "client_id")
    public TfyclientForm getClientId() {
        return clientId;
    }

    public void setClientId(TfyclientForm clientId) {
        this.clientId = clientId;
    }

    //联系提醒多对线索一
    @ManyToOne
    @JoinColumn(name = "clue_id")
    public TfyclueForm getClueId() {
        return clueId;
    }

    public void setClueId(TfyclueForm clueId) {
        this.clueId = clueId;
    }

    //联系提醒多对联系人一
    @ManyToOne
    @JoinColumn(name = "linkman_id")
    public TfylinkmanForm getLinkmanId() {
        return linkmanId;
    }

    public void setLinkmanId(TfylinkmanForm linkmanId) {
        this.linkmanId = linkmanId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TfyrelationwarnFrom that = (TfyrelationwarnFrom) o;
        return relationwarnId == that.relationwarnId &&
                Objects.equals(relationwarnNr, that.relationwarnNr) &&
                Objects.equals(relationwarnLx, that.relationwarnLx) &&
                Objects.equals(relationwarnTime, that.relationwarnTime) &&
                Objects.equals(relationwarnZt, that.relationwarnZt) &&
                Objects.equals(empId, that.empId) &&
                Objects.equals(clientId, that.clientId) &&
                Objects.equals(clueId, that.clueId) &&
                Objects.equals(linkmanId, that.linkmanId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(relationwarnId, relationwarnNr, relationwarnLx, relationwarnTime, relationwarnZt, empId, clientId, clueId, linkmanId);
    }

    public TfyrelationwarnFrom() {
    }

    public TfyrelationwarnFrom(int relationwarnId, String relationwarnNr, String relationwarnLx, Timestamp relationwarnTime, Integer relationwarnZt, QempFrom empId, TfyclientForm clientId, TfyclueForm clueId, TfylinkmanForm linkmanId, Integer relationwarnJd) {
        this.relationwarnId = relationwarnId;
        this.relationwarnNr = relationwarnNr;
        this.relationwarnLx = relationwarnLx;
        this.relationwarnTime = relationwarnTime;
        this.relationwarnZt = relationwarnZt;
        this.empId = empId;
        this.clientId = clientId;
        this.clueId = clueId;
        this.linkmanId = linkmanId;
    }

}
